package view;

import java.awt.GridLayout;

import javax.swing.JPanel;

import model.Set;

/**
 * Monitor panel
 * @author Adrien Ledeul
 * @version 0.1
 */
public class MonitorPanel extends JPanel
{
	private static final long serialVersionUID = 1L;
	
	private MonitorWindow monitorWindow; 
	private Set set;
	private Monitor2Panel monitorAPanel;
	private Monitor2Panel monitorBPanel;

	/**
	 * Constructors
	 * 
	 */
	public MonitorPanel()
	{
		super();
		this.build();
	}
	
	public MonitorPanel(MonitorWindow monitorWindow)
	{
		super();
		this.monitorWindow = monitorWindow;
		this.set = monitorWindow.getSet();
		this.build();
	}
	

	/**
	 * Getters & Setters
	 * 
	 */
	public MonitorWindow getMonitorWindow()
	{
		return monitorWindow;
	}
	
	public Set getSet() 
	{
		return set;
	}

	/**
	 * Build the panel
	 */
	private void build()
	{
		this.setLayout(new GridLayout(1,2));
		
		monitorAPanel = new Monitor2Panel(this, "A");
		this.add(monitorAPanel);
		
		monitorBPanel = new Monitor2Panel(this, "B");
		this.add(monitorBPanel);
	}

}
